// 测试新评论布局
console.log('=== 测试新评论布局 ===');

// 检查当前帖子数据
console.log('1. 检查当前帖子数据:');
console.log('帖子数量:', this.data.posts?.length || 0);

if (this.data.posts && this.data.posts.length > 0) {
  const firstPost = this.data.posts[0];
  console.log('第一个帖子:', {
    _id: firstPost._id,
    content: firstPost.content,
    likeCount: firstPost.likeCount,
    commentCount: firstPost.commentCount,
    showCommentInput: firstPost.showCommentInput,
    comments: firstPost.comments?.length || 0
  });
}

// 测试切换评论输入框
console.log('2. 测试切换评论输入框...');
if (this.data.posts && this.data.posts.length > 0) {
  const testEvent = {
    currentTarget: {
      dataset: {
        postId: this.data.posts[0]._id,
        index: 0
      }
    }
  };
  
  console.log('调用toggleCommentInput...');
  this.toggleCommentInput(testEvent);
  
  console.log('切换后的状态:', {
    showCommentInput: this.data.posts[0].showCommentInput,
    commentContent: this.data.posts[0].commentContent
  });
}

// 测试评论输入
console.log('3. 测试评论输入...');
if (this.data.posts && this.data.posts.length > 0) {
  const testInputEvent = {
    detail: { value: '测试评论内容' },
    currentTarget: {
      dataset: {
        postId: this.data.posts[0]._id,
        index: 0
      }
    }
  };
  
  console.log('调用onCommentInput...');
  this.onCommentInput(testInputEvent);
  
  console.log('输入后的状态:', {
    commentContent: this.data.posts[0].commentContent
  });
}

console.log('=== 测试完成 ===');
console.log('请检查页面显示效果，评论和点赞应该直接显示在帖子下方'); 